import sys
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *

class Examle(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()
    def initUI(self):
        lcd=QLCDNumber(self)
        slider=QSlider(Qt.Horizontal,self)
        vbox=QVBoxLayout()
        vbox.addWidget(lcd)
        vbox.addWidget(slider)
        self.setLayout(vbox)
        slider.valueChanged.connect(lcd.display)
        self.setWindowTitle("数据传递")

if __name__ == '__main__':
    app=QApplication(sys.argv)
    demo=Examle()
    demo.show()
    app.exec_()